public enum TextEnum {
    //枚举类的使用；
    RED(1,"红色"),GREEN(2,"蓝色"),BLACK(3,"黑色");
    public int number;
    public String color;
    TextEnum(int number, String color){
        this.number=number;
        this.color=color;
    }
    public static void main(String[] args){
        TextEnum[] textEnums=TextEnum.values();
        for(int i=0;i< textEnums.length;i++){
            System.out.println(textEnums[i]+"->"+textEnums[i].ordinal());
        }
        TextEnum tmp=TextEnum.valueOf("RED");
        System.out.println(tmp);
        System.out.println(GREEN.compareTo(RED));
    }
    public static void main1(String[] args){
        TextEnum textEnum=TextEnum.BLACK;
        switch (textEnum){
            case BLACK:
                System.out.println("BLACK");
                break;
            case RED:
                System.out.println("RED");
                break;
            case GREEN:
                System.out.println("GREEN");
                break;
            default:
                break;
        }
    }
}
